package Four;

import java.util.Scanner;

public class ArrayUtils {
	public static PairResult findMinMax(double[] values) {
		double max = values[0];
		double min = values[0];
		for (int i = 0; i < values.length; i++) {
			if (values[i] > max) {
				max = values[i];
			}
			if (values[i] < min) {
				min = values[i];
			}
		}
		PairResult p = new PairResult();
		p.max = max;
		p.min = min;
		return p;
	}

	public static class PairResult {
		private double min;
		private double max;

		public double getMin() {
			return min;
		}

		public void setMin(double min) {
			this.min = min;
		}

		public double getMax() {
			return max;
		}

		public void setMax(double max) {
			this.max = max;
		}

		@Override
		public String toString() {
			return "PairResult [min=" + min + ", max=" + max + "]";
		}

	}

}
